﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Xml.Linq;

public partial class home : System.Web.UI.MasterPage
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Session["candidate"] == null)
        {
            link_login.Visible = true;
            link_signin.Visible = true;
            link_general.Visible = false;
            layout_candidate.Visible = false;
        }
        else
        {
            if (LocalVariables.ARRAY_INFOR_CANDIDATE != null)
            {
                link_general.Visible = true;
                layout_candidate.Visible = true;
                link_login.Visible = false;
                link_signin.Visible = false;
                lbtn_candidate.Text = LocalVariables.ARRAY_INFOR_CANDIDATE[0];
            }
        }

        if (LocalVariables.HIDDEN_LOGO)
        {
            layout_flash.Visible = true;
        }
        else
        {
            layout_flash.Visible = false;
        }
    }

    protected void link_home_Click(object sender, EventArgs e)
    {
        LocalVariables.HIDDEN_LOGO = true;
        Response.Redirect("index.aspx");               
    }

    protected void link_signin_Click(object sender, EventArgs e)
    {
        LocalVariables.HIDDEN_LOGO = false;
        Response.Redirect("signin.aspx");        
    }

    protected void link_login_Click(object sender, EventArgs e)
    {
        LocalVariables.HIDDEN_LOGO = false;
        Response.Redirect("login.aspx");        
    }

    protected void lbtn_logout_Click(object sender, EventArgs e)
    {
        Session.Clear();
        LocalVariables.HIDDEN_LOGO = true;
        Response.Redirect("index.aspx");
    }

    protected void lbtn_candidate_Click(object sender, EventArgs e)
    {
        LocalVariables.HIDDEN_LOGO = false;
        Response.Redirect("profiles.aspx");
    }

    protected void link_general_Click(object sender, EventArgs e)
    {
        LocalVariables.HIDDEN_LOGO = false;
        Response.Redirect("profiles.aspx");
    }
}
